package com.ternnetwork.batch.mapper;


import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

import com.ternnetwork.batch.item.mapper.excel.ModelToExcelRowMapper;
import com.ternnetwork.batch.model.TestUser;



/**
 * 实体与Excel行映射
 * @author xuwenfeng
 *
 */
public class TestUserToExcelRowMapper implements ModelToExcelRowMapper {

	@Override
	public void mapRow(Object t,Sheet sheet,Workbook workbook,Integer rowIndex) throws Exception {
		
		 Row  row=sheet.createRow(rowIndex);
		
		 TestUser testUser=(TestUser)t;
		 
		 row.createCell(0).setCellValue(testUser.getId());
		 row.createCell(1).setCellValue(testUser.getName());
		 row.createCell(2).setCellValue(testUser.getAge());
		 
		
	}

}
